package com.mogist.hqc.oss;

import com.alibaba.sdk.android.oss.common.auth.OSSCredentialProvider;
import com.alibaba.sdk.android.oss.common.auth.OSSCustomSignerCredentialProvider;
import com.alibaba.sdk.android.oss.common.utils.OSSUtils;

/**
 * 作用：OSS配置信息
 * 作者：赵小白 email:vvtale@gmail.com  
 * 修改人：
 * 修改时间：
 * 修改备注：
 */
public class OSSConfig
{
	public static final String OSS_AccessKeyID = "LTAI5xuAO1OGjUEU";
	public static final String OSS_AccessKeySecret = "gtuLFgHkNMYjNAQLd7ICc2lrSf0Ms7";
	/** Bucket是OSS上的命名空间 */
	public static final String OSS_BucketName = "hqctv";
	/** 图片上传的地址 */
	public static final String OSS_EndPoint = "http://oss-cn-beijing.aliyuncs.com";
	/** 图片的访问地址的前缀  其实就是： bucketName . endpoint */
	public static final String OSS_Prefix = "https://hqctv.oss-cn-beijing.aliyuncs.com";

	/** 图片保存到OSS服务器的目录 */
	public static final  String OSS_Dir = "hqctv/";

	public static OSSCredentialProvider newCustomSignerCredentialProvider()
	{
		return new OSSCustomSignerCredentialProvider()
		{
			@Override public String signContent(String content)
			{
				return OSSUtils.sign(OSS_AccessKeyID, OSS_AccessKeySecret, content);
			}
		};
	}
}
